package org.jeecg.modules.school.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.school.entity.School;
import org.jeecg.modules.school.entity.vo.QueryVo;
import org.jeecg.modules.school.service.SciSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liujiamiao
 * @since 2020-11-18
 */
@RestController
@RequestMapping("/school/sci-school")
@Api(tags = "查询学校")
public class SciSchoolController {

    @Autowired
    private SciSchoolService sciSchoolService;

    /**
     * 分页查询学校
     * @param page
     * @param size
     * @param queryVo
     * @return
     */
    @ApiOperation("分页查询")
    @PostMapping("/list/{page}/{size}")
    public Result list(@PathVariable("page")Integer page,
                       @PathVariable("size")Integer size,
                       @RequestBody QueryVo queryVo){
        IPage<School> schoolIPage = sciSchoolService.queryPage(page,size,queryVo);

        return Result.ok(schoolIPage);
    }

}

